#pragma once

#include "ofMain.h"
#include "Options.h"
#include "Scene.h"
#include "SceneGui.h"

class SceneGui;

class TP1 : public ofBaseApp{

	private:
		bool altKey, ctrlKey;
		int prevWindowX, prevWindowY, prevWindowWidth, prevWindowHeight;
		int clickTime;
		ofVec3f clickPos;
		Options opt;
		Objet * currentObj;
		Scene scene;

		SceneGui gui;

		ofEasyCam cam;
		ofLight light;

		void changeSelection(Objet *);


	public:
		void setup();
		void update();
		void draw();
		void exit();

		void toggleFullscreen();
		void toggleFullscreen(bool full);

		void keyPressed(int key);
		void keyReleased(int key);
		void mouseMoved(int x, int y );
		void mouseDragged(int x, int y, int button);
		void mousePressed(int x, int y, int button);
		void mouseReleased(int x, int y, int button);
		void windowResized(int w, int h);
		void dragEvent(ofDragInfo dragInfo);
		void gotMessage(ofMessage msg);

		Objet * getCurrent();

		// Events called by SceneGui
		void addObjet(Objet&);
		void onChangeMode();
		void askSnapshot();
};
